Release 10.1A: OpenEdge Data Management:
SQL Reference
GET DIAGNOSTICS EXCEPTION
Retrieves information about the execution of the previous SQL statement from the SQL diagnostics area. The diagnostics area is a data structure that contains information about the execution status of the most recent SQL statement. Specifically,
GET DIAGNOSTICSEXCEPTIONextracts information about the SQL statement as a whole from the SQL diagnostics area’s detail component.The detail area contains information for a particular condition (an error, warning, or success condition) associated with execution of the last SQL statement. The diagnostics area can potentially contain multiple detail areas corresponding to multiple conditions generated by the SQL statement described by the header. The SQL diagnostics area currently supports only one detail area.
Note: TheGET DIAGNOSTICSstatement extracts header information.Syntax
EXCEPTION numberSpecifies that
GETDIAGNOSTICSEXCEPTIONextracts detail information. number specifies which of multiple detail areasGETDIAGNOSTICSextracts. Currently, number must be the integer 1.:paramReceives the information returned by the
GETDIAGNOSTICSEXCEPTIONstatement. The host-language program must declare a param compatible with the SQL data type of the information item.detail_info_itemOne of the following keywords, which returns associated information about the particular error condition:
CONDITION_NUMBERThe sequence of this detail area in the diagnostics area. Currently,
CONDITION_NUMBERis always 1.RETURNED_SQLSTATEThe
SQLSTATEvalue that corresponds to the condition.CLASS_ORIGINThe general type of error. For example,
connection exceptionordata exception.SUBCLASS_ORIGINThe specific error. Usually the same as the message text.
ENVIRONMENT_NAMENot currently supported.
CONNECTION_NAMENot currently supported.
CONSTRAINT_CATALOGNot currently supported.
CONSTRAINT_SCHEMANot currently supported.
CONSTRAINT_NAMENot currently supported.
CATALOG_NAMENot currently supported.
SCHEMA_NAMENot currently supported.
TABLE_NAMEThe name of the table, if the error condition involves a table.
COLUMN_NAMEThe name of the affected columns, if the error condition involves a column.
CURSOR_NAMENot currently supported.
MESSAGE_TEXTThe associated message text for the error condition.
MESSAGE_LENGTHThe length in characters of the message in the
MESSAGE_LENGTHitem.MESSAGE_OCTET_LENGTHNot currently supported.
ExampleThe
GET DIAGNOSTICS EXCEPTIONexample extracts detailed information into host variables that are defined in theDECLARE SECTIONof an embedded SQL program:
Note: The
GET DIAGNOSTICSstatement itself does not affect the contents of the diagnostics area. This means applications can issue multipleGET DIAGNOSTICSstatements to retrieve different items of information about the same SQL statement.Related statements
GET DIAGNOSTICS, WHENEVER
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |